package com.iwhalecloud.bss.kite.cucc.service.util;

import java.util.HashMap;
import java.util.Map;

import com.iwhalecloud.bss.kite.manager.enums.ActionType;

public class ChangeTypeUtils {

    public static final String CHANGE_TYPE_A = "0";
    public static final String CHANGE_TYPE_D = "1";
    public static final String CHANGE_TYPE_M = "2";
    public static final String CHANGE_TYPE_K = "9";

    private static final Map<String, String> CHANGE_TYPE_MAP = new HashMap<>();
    private static final Map<String, ActionType> ACTION_TYPE_MAP = new HashMap<>();

    static {
        CHANGE_TYPE_MAP.put(ActionType.A.name(), CHANGE_TYPE_A);
        CHANGE_TYPE_MAP.put(ActionType.D.name(), CHANGE_TYPE_D);
        CHANGE_TYPE_MAP.put(ActionType.M.name(), CHANGE_TYPE_M);
        CHANGE_TYPE_MAP.put(ActionType.K.name(), CHANGE_TYPE_K);
        //资费产品作废
        CHANGE_TYPE_MAP.put(ActionType.C.name(), CHANGE_TYPE_D);

        ACTION_TYPE_MAP.put(CHANGE_TYPE_A, ActionType.A);
        ACTION_TYPE_MAP.put(CHANGE_TYPE_D, ActionType.D);
        ACTION_TYPE_MAP.put(CHANGE_TYPE_M, ActionType.M);
        ACTION_TYPE_MAP.put(CHANGE_TYPE_K, ActionType.K);
    }

    public static String getChangeType(String actionType) {
        return CHANGE_TYPE_MAP.get(actionType);
    }

    public static ActionType getActionType(String changeType) {
        return ACTION_TYPE_MAP.get(changeType);
    }
}
